package com.open.exam.mapper;

import com.open.exam.databasemodel.Examinee;
import com.open.exam.dto.ExamineeExamPaperItem;
import com.open.exam.sqlprovider.ExamingProvider;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

/**
 * @author 奶茶
 * Created on 2017/11/9.
 */
@Mapper
public interface ExamingMapper {

    @SelectProvider(type = ExamingProvider.class,method = "findExamineeList")
    List<Examinee> findExamineeList();

    @SelectProvider(type = ExamingProvider.class,method = "findExamineeExamPaperItems")
    List<ExamineeExamPaperItem> findExamineeExamPaperItems();

    @Delete("delete from ExamineeExamPaper where ExamPaperInfoID in (#{strIds})")
    Integer deleteExamineeExamPaperByIds(@Param(value = "strIds") String strIds);

    @Delete("delete from ExamineeExamPaperItem where ExamPaperInfoID in (#{strExamPaperInfoIDs}) and PaperID in (#{strPaperIDs}) and ItemID in (#{strItemIDs})")
    Integer deleteExamineeExamPaperItemByIds(@Param(value = "strExamPaperInfoIDs") String strExamPaperInfoIDs, @Param(value = "strPaperIDs") String strPaperIDs, @Param(value = "strItemIDs") String strItemIDs);
}
